package org.xiaojl.common.base;

import java.io.Serializable;
import java.util.Date;

import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.mapper.Wrapper;

public abstract class BaseEntity implements Serializable {
	private static final long serialVersionUID = 1L;
	@TableId(type = IdType.ID_WORKER)
	protected Long id; //主键
	protected Long createBy=-1L; //创建人Id
	protected Date createTime=new Date(); //创建时间
	protected Integer delFlag=0; //删除标记：0-未删除，1-删除
	
	/**
	 * 构建查询条件Wrapper实例
	 */
	public abstract Wrapper<? extends BaseEntity> bindingQueryWrapper();

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getCreateBy() {
		return createBy;
	}

	public void setCreateBy(Long createBy) {
		this.createBy = createBy;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Integer getDelFlag() {
		return delFlag;
	}

	public void setDelFlag(Integer delFlag) {
		this.delFlag = delFlag;
	}

	@Override
	public String toString() {
		return "BaseEntity [id=" + id + ", createBy=" + createBy
				+ ", createTime=" + createTime + ", delFlag=" + delFlag + "]";
	}
	
}
